package gov.nist.ssd.swqb.core.search;

import java.util.Iterator;
import java.util.NoSuchElementException;

import com.hp.hpl.jena.rdf.model.RDFNode;

class InvalidSearch implements Search {

  private String errorDescription;
  
	public InvalidSearch(String fullSearch, String errorDescription) {
	  this.errorDescription = "this search '" + fullSearch+"' is invalid" +
	  		                    "because '" + errorDescription +"'";
	}

  @Override
  public Iterator<RDFNode> iterator() {
    return new Iterator<RDFNode>() {

			@Override
      public boolean hasNext() {
	      return false;
      }

			@Override
      public RDFNode next() {
	      throw new NoSuchElementException();
      }

			@Override
      public void remove() {
	      throw new UnsupportedOperationException();
      }
		};
  }

  @Override
  public boolean isValid() {
    return false;
  }

  @Override
  public String getErrorDescription() {
    return errorDescription;
  }
}
